home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / scramble.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  72KB  |  1,879 lines

  1. /***************************************************************************
  2.  
  3. Scramble memory map (preliminary)
  4.  
  5. MAIN BOARD:
  6. 0000-3fff ROM
  7. 4000-47ff RAM
  8. 4800-4bff Video RAM
  9. 5000-50ff Object RAM
  10. 5000-503f  screen attributes
  11. 5040-505f  sprites
  12. 5060-507f  bullets
  13. 5080-50ff  unused?
  14.  
  15. read:
  16. 7000      Watchdog Reset (Scramble)
  17. 7800      Watchdog Reset (Battle of Atlantis)
  18. 8100      IN0
  19. 8101      IN1
  20. 8102      IN2 (bits 5 and 7 used for protection check in Scramble)
  21.  
  22. write:
  23. 6801      interrupt enable
  24. 6802      coin counter
  25. 6803      ? (POUT1)
  26. 6804      stars on
  27. 6805      ? (POUT2)
  28. 6806      screen vertical flip
  29. 6807      screen horizontal flip
  30. 8200      To AY-3-8910 port A (commands for the audio CPU)
  31. 8201      bit 3 = interrupt trigger on audio CPU  bit 4 = AMPM (?)
  32. 8202      protection check control?
  33.  
  34.  
  35. SOUND BOARD:
  36. 0000-1fff ROM
  37. 8000-83ff RAM
  38.  
  39. I/0 ports:
  40. read:
  41. 20      8910 #2  read
  42. 80      8910 #1  read
  43.  
  44. write
  45. 10      8910 #2  control20      8910 #2  write
  46. 40      8910 #1  control
  47. 80      8910 #1  write
  48.  
  49. interrupts:
  50. interrupt mode 1 triggered by the main CPU
  51.  
  52.  
  53. Interesting tidbit:
  54.  
  55. There is a bug in Amidars. Look at the loop at 0x2715. It expects DE to be
  56. saved during the call to 0x2726, but it can be destroyed, causing the loop
  57. to read all kinds of bogus memory locations.
  58.  
  59.  
  60. To Do:
  61.  
  62. - Mariner has discrete sound circuits connected to the 8910's output ports
  63.  
  64.  
  65. Notes:
  66.  
  67. - While Atlantis has a cabinet switch, it doesn't use the 2nd player controls
  68.   in cocktail mode.
  69.  
  70. ***************************************************************************/
  71.  
  72. #include "driver.h"
  73. #include "vidhrdw/generic.h"
  74.  
  75.  
  76. extern unsigned char *galaxian_attributesram;
  77. extern unsigned char *galaxian_bulletsram;
  78. extern size_t galaxian_bulletsram_size;
  79. void galaxian_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  80. void mariner_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  81. WRITE_HANDLER( galaxian_flipx_w );
  82. WRITE_HANDLER( galaxian_flipy_w );
  83. WRITE_HANDLER( hotshock_flipscreen_w );
  84. WRITE_HANDLER( galaxian_attributes_w );
  85. WRITE_HANDLER( galaxian_stars_w );
  86. WRITE_HANDLER( scramble_background_w );
  87.  
  88. int  scramble_vh_start(void);
  89. int  mariner_vh_start(void);
  90. int  ckongs_vh_start(void);
  91. int  pisces_vh_start(void);
  92.  
  93. void galaxian_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  94.  
  95. WRITE_HANDLER( pisces_gfxbank_w );
  96.  
  97. int  scramble_vh_interrupt(void);
  98. int  mariner_vh_interrupt(void);
  99. int  hunchbks_vh_interrupt(void);
  100. WRITE_HANDLER( scramble_filter_w );
  101.  
  102. READ_HANDLER( scramble_portB_r );
  103. WRITE_HANDLER( scramble_sh_irqtrigger_w );
  104. WRITE_HANDLER( hotshock_sh_irqtrigger_w );
  105.  
  106. READ_HANDLER( frogger_portB_r );
  107.  
  108. /* protection stuff. in machine\scramble.c */
  109. READ_HANDLER( scramble_input_port_2_r );
  110. READ_HANDLER( scramble_protection_r );
  111. READ_HANDLER( scramblk_protection_r );
  112. READ_HANDLER( mariner_protection_1_r );
  113. READ_HANDLER( mariner_protection_2_r );
  114. READ_HANDLER( mariner_pip_r );
  115. READ_HANDLER( mariner_pap_r );
  116.  
  117.  
  118. static READ_HANDLER( ckongs_input_port_1_r )
  119. {
  120.     return (readinputport(1) & 0xfc) | ((readinputport(2) & 0x06) >> 1);
  121. }
  122.  
  123. static READ_HANDLER( ckongs_input_port_2_r )
  124. {
  125.     return (readinputport(2) & 0xf9) | ((readinputport(1) & 0x03) << 1);
  126. }
  127.  
  128. static WRITE_HANDLER( scramble_coin_counter_2_w )
  129. {
  130.     coin_counter_w(1, data);
  131. }
  132.  
  133. static WRITE_HANDLER( scramble_coin_counter_3_w )
  134. {
  135.     coin_counter_w(2, data);
  136. }
  137.  
  138.  
  139. static struct MemoryReadAddress scramble_readmem[] =
  140. {
  141.     { 0x0000, 0x3fff, MRA_ROM },
  142.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM and Video RAM */
  143.     { 0x4c00, 0x4fff, videoram_r },    /* mirror address */
  144.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites, bullets */
  145.     { 0x7000, 0x7000, watchdog_reset_r },
  146.     { 0x7800, 0x7800, watchdog_reset_r },
  147.     { 0x8100, 0x8100, input_port_0_r },    /* IN0 */
  148.     { 0x8101, 0x8101, input_port_1_r },    /* IN1 */
  149.     { 0x8102, 0x8102, input_port_2_r },    /* IN2 */
  150.     { -1 }    /* end of table */
  151. };
  152.  
  153. static struct MemoryReadAddress ckongs_readmem[] =
  154. {
  155.     { 0x0000, 0x5fff, MRA_ROM },
  156.     { 0x6000, 0x6bff, MRA_RAM },                /* RAM */
  157.     { 0x7000, 0x7000, input_port_0_r },            /* IN0 */
  158.     { 0x7001, 0x7001, ckongs_input_port_1_r },    /* IN1 */
  159.     { 0x7002, 0x7002, ckongs_input_port_2_r },    /* IN2 */
  160.     { 0x9000, 0x93ff, MRA_RAM },                /* Video RAM */
  161.     { 0x9800, 0x987f, MRA_RAM },                /* screen attributes, sprites, bullets */
  162.     { 0xb000, 0xb000, watchdog_reset_r },
  163.     { -1 }    /* end of table */
  164. };
  165.  
  166. /* Extra ROM and protection locations */
  167. static struct MemoryReadAddress mariner_readmem[] =
  168. {
  169.     { 0x0000, 0x3fff, MRA_ROM },
  170.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM and Video RAM */
  171.     { 0x4c00, 0x4fff, videoram_r },    /* mirror address */
  172.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites, bullets */
  173.     { 0x5800, 0x67ff, MRA_ROM },
  174.     { 0x7000, 0x7000, watchdog_reset_r },
  175.     { 0x8100, 0x8100, input_port_0_r },    /* IN0 */
  176.     { 0x8101, 0x8101, input_port_1_r },    /* IN1 */
  177.     { 0x8102, 0x8102, input_port_2_r },    /* IN2 */
  178.     { 0x9008, 0x9008, mariner_protection_2_r },
  179.     { 0xb401, 0xb401, mariner_protection_1_r },
  180.     { -1 }    /* end of table */
  181. };
  182.  
  183. static struct MemoryReadAddress mars_readmem[] =
  184. {
  185.     { 0x0000, 0x3fff, MRA_ROM },
  186.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM and Video RAM */
  187.     { 0x4c00, 0x4fff, videoram_r },    /* mirror address */
  188.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites, bullets */
  189.     { 0x7000, 0x7000, watchdog_reset_r },
  190.     { 0x8100, 0x8100, input_port_0_r },    /* IN0 */
  191.     { 0x8102, 0x8102, input_port_1_r },    /* IN1 */
  192.     { 0x8108, 0x8108, input_port_2_r },    /* IN2 */
  193.     { 0x8208, 0x8208, input_port_3_r },    /* IN3 */
  194.     { 0xa000, 0xafff, MRA_ROM },    /* Sinbad 7 */
  195.     { 0xc100, 0xc100, input_port_0_r },    /* IN0 - Sinbad 7 */
  196.     { 0xc102, 0xc102, input_port_1_r },    /* IN1 - Sinbad 7 */
  197.     { 0xc108, 0xc108, input_port_2_r },    /* IN2 - Sinbad 7 */
  198.     { -1 }    /* end of table */
  199. };
  200.  
  201. static struct MemoryReadAddress hotshock_readmem[] =
  202. {
  203.     { 0x0000, 0x3fff, MRA_ROM },
  204.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM and Video RAM */
  205.     { 0x4c00, 0x4fff, videoram_r },    /* mirror address */
  206.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites, bullets */
  207.     { 0x8000, 0x8000, input_port_0_r },    /* IN0 */
  208.     { 0x8001, 0x8001, input_port_1_r },    /* IN1 */
  209.     { 0x8002, 0x8002, input_port_2_r },    /* IN2 */
  210.     { 0x8003, 0x8003, input_port_3_r },    /* IN3 */
  211.     { -1 }    /* end of table */
  212. };
  213.  
  214. READ_HANDLER( hunchbks_mirror_r )
  215. {
  216.     return cpu_readmem16(0x1000+offset);
  217. }
  218.  
  219. WRITE_HANDLER( hunchbks_mirror_w )
  220. {
  221.     cpu_writemem16(0x1000+offset,data);
  222. }
  223.  
  224. static struct MemoryReadAddress hunchbks_readmem[] =
  225. {
  226.     { 0x0000, 0x0fff, MRA_ROM },
  227.     { 0x2000, 0x2fff, MRA_ROM },
  228.     { 0x4000, 0x4fff, MRA_ROM },
  229.     { 0x6000, 0x6fff, MRA_ROM },
  230.     { 0x1c00, 0x1fff, MRA_RAM },
  231.     { 0x1800, 0x1bff, videoram_r },
  232.     { 0x1400, 0x147f, MRA_RAM },    /* screen attributes, sprites, bullets */
  233.     { 0x1500, 0x1500, input_port_0_r },    /* IN0 */
  234.     { 0x1501, 0x1501, input_port_1_r },    /* IN1 */
  235.     { 0x1502, 0x1502, input_port_2_r },    /* IN2 */
  236.     { 0x1680, 0x1680, watchdog_reset_r },
  237.     { 0x3000, 0x3fff, hunchbks_mirror_r },
  238.     { 0x5000, 0x5fff, hunchbks_mirror_r },
  239.     { 0x7000, 0x7fff, hunchbks_mirror_r },
  240.     { -1 }    /* end of table */
  241. };
  242.  
  243.  
  244. static struct MemoryWriteAddress scramble_writemem[] =
  245. {
  246.     { 0x0000, 0x3fff, MWA_ROM },
  247.     { 0x4000, 0x47ff, MWA_RAM },
  248.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  249.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  250.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  251.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  252.     { 0x6801, 0x6801, interrupt_enable_w },
  253.     { 0x6802, 0x6802, coin_counter_w },
  254.     { 0x6803, 0x6803, scramble_background_w },
  255.     { 0x6804, 0x6804, galaxian_stars_w },
  256.     { 0x6806, 0x6806, galaxian_flipx_w },
  257.     { 0x6807, 0x6807, galaxian_flipy_w },
  258.     { 0x8200, 0x8200, soundlatch_w },
  259.     { 0x8201, 0x8201, scramble_sh_irqtrigger_w },
  260.     { -1 }    /* end of table */
  261. };
  262.  
  263. static struct MemoryWriteAddress triplep_writemem[] =
  264. {
  265.     { 0x0000, 0x3fff, MWA_ROM },
  266.     { 0x4000, 0x47ff, MWA_RAM },
  267.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  268.     { 0x4c00, 0x4fff, videoram_w },    /* mirror address */
  269.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  270.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  271.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  272.     { 0x6801, 0x6801, interrupt_enable_w },
  273.     { 0x6802, 0x6802, coin_counter_w },
  274.     { 0x6803, 0x6803, MWA_NOP },   /* ??? (it's NOT a background enable) */
  275.     { 0x6804, 0x6804, galaxian_stars_w },
  276.     { 0x6806, 0x6806, galaxian_flipx_w },
  277.     { 0x6807, 0x6807, galaxian_flipy_w },
  278.     { -1 }    /* end of table */
  279. };
  280.  
  281. static struct MemoryWriteAddress ckongs_writemem[] =
  282. {
  283.     { 0x0000, 0x5fff, MWA_ROM },
  284.     { 0x6000, 0x6bff, MWA_RAM },
  285.     { 0x7800, 0x7800, soundlatch_w },
  286.     { 0x7801, 0x7801, scramble_sh_irqtrigger_w },
  287.     { 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
  288.     { 0x9800, 0x983f, galaxian_attributes_w, &galaxian_attributesram },
  289.     { 0x9840, 0x985f, MWA_RAM, &spriteram, &spriteram_size },
  290.     { 0x9860, 0x987f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  291.     { 0xa801, 0xa801, interrupt_enable_w },
  292.     { 0xa802, 0xa802, coin_counter_w },
  293.     { 0xa804, 0xa804, galaxian_stars_w },
  294.     { 0xa806, 0xa806, galaxian_flipx_w },
  295.     { 0xa807, 0xa807, galaxian_flipy_w },
  296.     { -1 }    /* end of table */
  297. };
  298.  
  299. static struct MemoryWriteAddress mars_writemem[] =
  300. {
  301.     { 0x0000, 0x3fff, MWA_ROM },
  302.     { 0x4000, 0x47ff, MWA_RAM },
  303.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  304.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  305.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  306.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  307.     { 0x5080, 0x50ff, MWA_NOP },    /* unused */
  308.     { 0x6800, 0x6800, scramble_coin_counter_2_w },
  309.     { 0x6801, 0x6801, galaxian_stars_w },
  310.     { 0x6802, 0x6802, interrupt_enable_w },
  311.     { 0x6808, 0x6808, coin_counter_w },
  312.     { 0x6809, 0x6809, galaxian_flipx_w },
  313.     { 0x680b, 0x680b, galaxian_flipy_w },
  314.     { 0x810a, 0x810a, MWA_NOP },    /* ??? */
  315.     { 0x8200, 0x8200, soundlatch_w },
  316.     { 0x8202, 0x8202, scramble_sh_irqtrigger_w },
  317.     { 0x820a, 0x820a, MWA_NOP },    /* ??? */
  318.     { 0xa000, 0xafff, MWA_ROM },    /* Sinbad 7 */
  319.     { 0xc10a, 0xc10a, MWA_NOP },    /* ??? - Sinbad 7 */
  320.     { 0xc20a, 0xc20a, MWA_NOP },    /* ??? - Sinbad 7 */
  321.     { -1 }    /* end of table */
  322. };
  323.  
  324. static struct MemoryWriteAddress hotshock_writemem[] =
  325. {
  326.     { 0x0000, 0x3fff, MWA_ROM },
  327.     { 0x4000, 0x47ff, MWA_RAM },
  328.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  329.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  330.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  331.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  332.     { 0x6000, 0x6000, scramble_coin_counter_3_w },
  333.     { 0x6002, 0x6002, scramble_coin_counter_2_w },
  334.     { 0x6004, 0x6004, hotshock_flipscreen_w },
  335.     { 0x6005, 0x6005, coin_counter_w },
  336.     { 0x6006, 0x6006, pisces_gfxbank_w },
  337.     { 0x6801, 0x6801, interrupt_enable_w },
  338.     { 0x7000, 0x7000, watchdog_reset_w },
  339.     { 0x8000, 0x8000, soundlatch_w },
  340.     { 0x9000, 0x9000, hotshock_sh_irqtrigger_w },
  341.     { -1 }    /* end of table */
  342. };
  343.  
  344. static struct MemoryWriteAddress hunchbks_writemem[] =
  345. {
  346.     { 0x0000, 0x0fff, MWA_ROM },
  347.     { 0x2000, 0x2fff, MWA_ROM },
  348.     { 0x4000, 0x4fff, MWA_ROM },
  349.     { 0x6000, 0x6fff, MWA_ROM },
  350.     { 0x1800, 0x1bff, videoram_w, &videoram, &videoram_size },
  351.     { 0x1c00, 0x1fff, MWA_RAM },
  352.     { 0x1400, 0x143f, galaxian_attributes_w, &galaxian_attributesram },
  353.     { 0x1440, 0x145f, MWA_RAM, &spriteram, &spriteram_size },
  354.     { 0x1460, 0x147f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  355.     { 0x1606, 0x1606, galaxian_flipx_w },
  356.     { 0x1607, 0x1607, galaxian_flipy_w },
  357.     { 0x1210, 0x1210, soundlatch_w },
  358.     { 0x1211, 0x1211, scramble_sh_irqtrigger_w },
  359.     { 0x3000, 0x3fff, hunchbks_mirror_w },
  360.     { 0x5000, 0x5fff, hunchbks_mirror_w },
  361.     { 0x7000, 0x7fff, hunchbks_mirror_w },
  362.     { -1 }    /* end of table */
  363. };
  364.  
  365. static struct IOReadPort triplep_readport[] =
  366. {
  367.     { 0x01, 0x01, AY8910_read_port_0_r },
  368.     { 0x02, 0x02, mariner_pip_r },
  369.     { 0x03, 0x03, mariner_pap_r },
  370.     { -1 }    /* end of table */
  371. };
  372.  
  373. static struct IOWritePort triplep_writeport[] =
  374. {
  375.     { 0x01, 0x01, AY8910_control_port_0_w },
  376.     { 0x00, 0x00, AY8910_write_port_0_w },
  377.     { -1 }    /* end of table */
  378. };
  379.  
  380.  
  381.  
  382. static struct MemoryReadAddress scramble_sound_readmem[] =
  383. {
  384.     { 0x0000, 0x1fff, MRA_ROM },
  385.     { 0x8000, 0x83ff, MRA_RAM },
  386.     { -1 }    /* end of table */
  387. };
  388.  
  389. static struct MemoryWriteAddress scramble_sound_writemem[] =
  390. {
  391.     { 0x0000, 0x1fff, MWA_ROM },
  392.     { 0x8000, 0x83ff, MWA_RAM },
  393.     { 0x9000, 0x9fff, scramble_filter_w },
  394.     { -1 }    /* end of table */
  395. };
  396.  
  397.  
  398. static struct MemoryReadAddress froggers_sound_readmem[] =
  399. {
  400.     { 0x0000, 0x17ff, MRA_ROM },
  401.     { 0x4000, 0x43ff, MRA_RAM },
  402.     { -1 }    /* end of table */
  403. };
  404.  
  405. static struct MemoryWriteAddress froggers_sound_writemem[] =
  406. {
  407.     { 0x0000, 0x17ff, MWA_ROM },
  408.     { 0x4000, 0x43ff, MWA_RAM },
  409.   //{ 0x6000, 0x6fff, scramble_filter_w },  /* There is probably a filter here,     */
  410.                                               /* but it can't possibly be the same */
  411.     { -1 }    /* end of table */                /* as the one in Scramble. One 8910 only */
  412. };
  413.  
  414.  
  415. static struct IOReadPort scramble_sound_readport[] =
  416. {
  417.     { 0x20, 0x20, AY8910_read_port_1_r },
  418.     { 0x80, 0x80, AY8910_read_port_0_r },
  419.     { -1 }    /* end of table */
  420. };
  421.  
  422. static struct IOWritePort scramble_sound_writeport[] =
  423. {
  424.     { 0x10, 0x10, AY8910_control_port_1_w },
  425.     { 0x20, 0x20, AY8910_write_port_1_w },
  426.     { 0x40, 0x40, AY8910_control_port_0_w },
  427.     { 0x80, 0x80, AY8910_write_port_0_w },
  428.     { -1 }    /* end of table */
  429. };
  430.  
  431.  
  432. static struct IOReadPort froggers_sound_readport[] =
  433. {
  434.     { 0x40, 0x40, AY8910_read_port_0_r },
  435.     { -1 }    /* end of table */
  436. };
  437.  
  438. static struct IOWritePort froggers_sound_writeport[] =
  439. {
  440.     { 0x40, 0x40, AY8910_write_port_0_w },
  441.     { 0x80, 0x80, AY8910_control_port_0_w },
  442.     { -1 }    /* end of table */
  443. };
  444.  
  445.  
  446. static struct IOReadPort hotshock_sound_readport[] =
  447. {
  448.     { 0x20, 0x20, AY8910_read_port_1_r },
  449.     { 0x40, 0x40, AY8910_read_port_0_r },
  450.     { -1 }    /* end of table */
  451. };
  452.  
  453. static struct IOWritePort hotshock_sound_writeport[] =
  454. {
  455.     { 0x10, 0x10, AY8910_control_port_1_w },
  456.     { 0x20, 0x20, AY8910_write_port_1_w },
  457.     { 0x40, 0x40, AY8910_write_port_0_w },
  458.     { 0x80, 0x80, AY8910_control_port_0_w },
  459.     { -1 }    /* end of table */
  460. };
  461.  
  462.  
  463. INPUT_PORTS_START( scramble )
  464.     PORT_START    /* IN0 */
  465.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  466.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  467.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  468.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  469.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  470.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  471.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  472.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  473.  
  474.     PORT_START    /* IN1 */
  475.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  476.     PORT_DIPSETTING(    0x00, "3" )
  477.     PORT_DIPSETTING(    0x01, "4" )
  478.     PORT_DIPSETTING(    0x02, "5" )
  479.     PORT_BITX( 0,       0x03, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
  480.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  481.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  482.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  483.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  484.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  485.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  486.  
  487.     PORT_START    /* IN2 */
  488.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  489.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  490.     PORT_DIPSETTING(    0x00, "A 1/1  B 2/1  C 1/1" )
  491.     PORT_DIPSETTING(    0x02, "A 1/2  B 1/1  C 1/2" )
  492.     PORT_DIPSETTING(    0x04, "A 1/3  B 3/1  C 1/3" )
  493.     PORT_DIPSETTING(    0x06, "A 1/4  B 4/1  C 1/4" )
  494.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  495.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  496.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  497.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  498.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  499.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  500.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  501. INPUT_PORTS_END
  502.  
  503. INPUT_PORTS_START( atlantis )
  504.     PORT_START    /* IN0 */
  505.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  506.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  507.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  508.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  509.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  510.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  511.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  512.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  513.  
  514.     PORT_START    /* IN1 */
  515.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  516.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  517.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  518.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
  519.     PORT_DIPSETTING(    0x02, "3" )
  520.     PORT_DIPSETTING(    0x00, "5" )
  521.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  522.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  523.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  524.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  525.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  526.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  527.  
  528.     PORT_START    /* IN2 */
  529.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  530.     PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) )
  531.     PORT_DIPSETTING(    0x02, "A 1/3  B 2/1" )
  532.     PORT_DIPSETTING(    0x00, "A 1/6  B 1/1" )
  533.     PORT_DIPSETTING(    0x04, "A 1/99 B 1/99")
  534.     /* all the other combos give 99 credits */
  535.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  536.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  537.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  538.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  539. INPUT_PORTS_END
  540.  
  541. /* same as scramble, dip switches are different */
  542. INPUT_PORTS_START( theend )
  543.     PORT_START    /* IN0 */
  544.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  545.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  546.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  547.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  548.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  549.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  550.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  551.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  552.  
  553.     PORT_START    /* IN1 */
  554.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  555.     PORT_DIPSETTING(    0x00, "3" )
  556.     PORT_DIPSETTING(    0x01, "4" )
  557.     PORT_DIPSETTING(    0x02, "5" )
  558.     PORT_BITX( 0,       0x03, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "256", IP_KEY_NONE, IP_JOY_NONE )
  559.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  560.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  561.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  562.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  563.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  564.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  565.  
  566.     PORT_START    /* IN2 */
  567.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  568.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  569.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
  570.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  571.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  572.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
  573.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  574.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  575.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  576.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  577.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  578.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  579.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  580. INPUT_PORTS_END
  581.  
  582. INPUT_PORTS_START( froggers )
  583.     PORT_START    /* IN0 */
  584.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  585.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
  586.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  587.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot1 - unused */
  588.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  589.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  590.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  591.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  592.  
  593.     PORT_START    /* IN1 */
  594.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  595.     PORT_DIPSETTING(    0x00, "3" )
  596.     PORT_DIPSETTING(    0x01, "5" )
  597.     PORT_DIPSETTING(    0x02, "7" )
  598.     PORT_BITX( 0,       0x03, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "256", IP_KEY_NONE, IP_JOY_NONE )
  599.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot2 - unused */
  600.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot1 - unused */
  601.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  602.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  603.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  604.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  605.  
  606.     PORT_START    /* IN2 */
  607.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  608.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  609.     PORT_DIPSETTING(    0x02, "A 2/1 B 2/1 C 2/1" )
  610.     PORT_DIPSETTING(    0x04, "A 2/1 B 1/3 C 2/1" )
  611.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/1 C 1/1" )
  612.     PORT_DIPSETTING(    0x06, "A 1/1 B 1/6 C 1/1" )
  613.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  614.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  615.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  616.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  617.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  618.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  619.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  620. INPUT_PORTS_END
  621.  
  622. INPUT_PORTS_START( amidars )
  623.     PORT_START    /* IN0 */
  624.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  625.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
  626.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  627.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  628.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  629.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  630.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  631.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  632.  
  633.     PORT_START    /* IN1 */
  634.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  635.     PORT_DIPSETTING(    0x03, "2" )
  636.     PORT_DIPSETTING(    0x02, "3" )
  637.     PORT_DIPSETTING(    0x01, "4" )
  638.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "256", IP_KEY_NONE, IP_JOY_NONE )
  639.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  640.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  641.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  642.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  643.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  644.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  645.  
  646.     PORT_START    /* IN2 */
  647.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  648.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
  649.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
  650.     PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
  651.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  652.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  653.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  654.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  655.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  656.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  657.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  658.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  659.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  660.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  661.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  662.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  663.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  664.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  665.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  666. INPUT_PORTS_END
  667.  
  668. INPUT_PORTS_START( triplep )
  669.     PORT_START    /* IN0 */
  670.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  671.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  672.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  673.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  674.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  675.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  676.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  677.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  678.  
  679.     PORT_START    /* IN1 */
  680.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  681.     PORT_DIPSETTING(    0x00, "3" )
  682.     PORT_DIPSETTING(    0x01, "4" )
  683.     PORT_DIPSETTING(    0x02, "5" )
  684.     PORT_BITX( 0,       0x03, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "256", IP_KEY_NONE, IP_JOY_NONE )
  685.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  686.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  687.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  688.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  689.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  690.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  691.  
  692.     PORT_START    /* IN2 */
  693.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  694.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  695.     PORT_DIPSETTING(    0x02, "A 1/2 B 1/1 C 1/2" )
  696.     PORT_DIPSETTING(    0x04, "A 1/3 B 3/1 C 1/3" )
  697.     PORT_DIPSETTING(    0x00, "A 1/1 B 2/1 C 1/1" )
  698.     PORT_DIPSETTING(    0x06, "A 1/4 B 4/1 C 1/4" )
  699.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  700.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  701.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  702.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  703.     PORT_SERVICE( 0x20, IP_ACTIVE_HIGH )
  704.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  705.     PORT_BITX(    0x80, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  706.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  707.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  708. INPUT_PORTS_END
  709.  
  710. INPUT_PORTS_START( ckongs )
  711.     PORT_START      /* IN0 */
  712.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  713.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  714.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  715.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  716.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  717.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  718.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  719.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  720.  
  721.     PORT_START      /* IN1 */
  722.     /* the coinage dip switch is spread across bits 0/1 of port 1 and bit 3 of port 2. */
  723.     /* To handle that, we swap bits 0/1 of port 1 and bits 1/2 of port 2 - this is handled */
  724.     /* by ckongs_input_port_N_r() */
  725.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
  726.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  727.     PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
  728.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
  729.     PORT_DIPSETTING(    0x02, "3" )
  730.     PORT_DIPSETTING(    0x00, "4" )
  731.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  732.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  733.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  734.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  735.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  736.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  737.  
  738.     PORT_START      /* IN2 */
  739.     /* the coinage dip switch is spread across bits 0/1 of port 1 and bit 3 of port 2. */
  740.     /* To handle that, we swap bits 0/1 of port 1 and bits 1/2 of port 2 - this is handled */
  741.     /* by ckongs_input_port_N_r() */
  742.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  743.     PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coinage ) )
  744.     PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
  745.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  746.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
  747.     PORT_DIPSETTING(    0x0a, DEF_STR( 2C_1C ) )
  748.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_1C ) )
  749.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
  750.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
  751.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
  752.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  753.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  754.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  755.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* probably unused */
  756. INPUT_PORTS_END
  757.  
  758. INPUT_PORTS_START( mars )
  759.     PORT_START    /* IN0 */
  760.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY | IPF_COCKTAIL )
  761.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
  762.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
  763.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  764.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY )
  765.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY )
  766.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  767.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  768.  
  769.     PORT_START    /* IN1 */
  770.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coin_B ) )
  771.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
  772.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ) )
  773.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coin_A ) )
  774.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  775.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  776.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  777.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  778.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY | IPF_COCKTAIL )
  779.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY | IPF_COCKTAIL )
  780.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  781.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  782.  
  783.     PORT_START    /* IN2 */
  784.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY | IPF_COCKTAIL )  /* this also control cocktail mode */
  785.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  786.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  787.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  788.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  789.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  790.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  791.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
  792.     PORT_DIPSETTING(    0x08, "3" )
  793.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
  794.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY )
  795.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  796.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY )
  797.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  798.  
  799.     PORT_START    /* IN3 */
  800.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  801.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  802.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  803.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY | IPF_COCKTAIL )
  804. INPUT_PORTS_END
  805.  
  806. INPUT_PORTS_START( devilfsh )
  807.     PORT_START    /* IN0 */
  808.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  809.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  810.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  811.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  812.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  813.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  814.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  815.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  816.  
  817.     PORT_START    /* IN1 */
  818.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
  819.     PORT_DIPSETTING(    0x00, "10000" )
  820.     PORT_DIPSETTING(    0x01, "15000" )
  821.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
  822.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  823.     PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
  824.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  825.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  826.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  827.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  828.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  829.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  830.  
  831.     PORT_START    /* IN2 */
  832.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  833.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  834.     PORT_DIPSETTING(    0x00, "4" )
  835.     PORT_DIPSETTING(    0x02, "5" )
  836.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coin_A ) )
  837.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  838.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )
  839.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coin_B ) )
  840.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  841.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  842.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_8WAY )
  843.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  844.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  845.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  846.  
  847.     PORT_START    /* IN3 - unused */
  848. INPUT_PORTS_END
  849.  
  850. INPUT_PORTS_START( newsin7 )
  851.     PORT_START    /* IN0 */
  852.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  853.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  854.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  855.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  856.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  857.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  858.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  859.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  860.  
  861.     PORT_START    /* IN1 */
  862.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
  863.     PORT_DIPSETTING(    0x03, " A 1C/1C  B 2C/1C" )
  864.     PORT_DIPSETTING(    0x01, " A 1C/3C  B 3C/1C" )
  865.     PORT_DIPSETTING(    0x02, " A 1C/2C  B 1C/1C" )
  866.     PORT_DIPSETTING(    0x00, " A 1C/4C  B 4C/1C" )
  867.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  868.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  869.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  870.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  871.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  872.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  873.  
  874.     PORT_START    /* IN2 */
  875.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  876.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
  877.     PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
  878.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  879.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )  /* difficulty? */
  880.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  881.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  882.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
  883.     PORT_DIPSETTING(    0x00, "3" )
  884.     PORT_DIPSETTING(    0x08, "5" )
  885.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  886.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  887.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  888.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  889.  
  890.     PORT_START    /* IN3 - unused */
  891. INPUT_PORTS_END
  892.  
  893. INPUT_PORTS_START( hotshock )
  894.     PORT_START    /* IN0 */
  895.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  896.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  897.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  898.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  899.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  900.     PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  901.  
  902.     PORT_START    /* IN1 */
  903.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  904.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  905.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
  906.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
  907.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 )
  908.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* pressing this disables the coins */
  909.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
  910.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
  911.  
  912.     PORT_START    /* IN2 */
  913.     PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) )
  914.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  915.     PORT_DIPSETTING(    0x09, DEF_STR( 2C_2C ) )
  916.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  917.     PORT_DIPSETTING(    0x0a, DEF_STR( 2C_3C ) )
  918.     PORT_DIPSETTING(    0x0b, DEF_STR( 2C_4C ) )
  919.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  920.     PORT_DIPSETTING(    0x0c, DEF_STR( 2C_5C ) )
  921.     PORT_DIPSETTING(    0x0d, DEF_STR( 2C_6C ) )
  922.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  923.     PORT_DIPSETTING(    0x0e, DEF_STR( 2C_7C ) )
  924.     PORT_DIPSETTING(    0x0f, DEF_STR( 2C_8C ) )
  925.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  926.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  927.     PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
  928.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_7C ) )
  929.     PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
  930.     PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_A ) )
  931.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  932.     PORT_DIPSETTING(    0x90, DEF_STR( 2C_2C ) )
  933.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  934.     PORT_DIPSETTING(    0xa0, DEF_STR( 2C_3C ) )
  935.     PORT_DIPSETTING(    0xb0, DEF_STR( 2C_4C ) )
  936.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
  937.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_5C ) )
  938.     PORT_DIPSETTING(    0xd0, DEF_STR( 2C_6C ) )
  939.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
  940.     PORT_DIPSETTING(    0xe0, DEF_STR( 2C_7C ) )
  941.     PORT_DIPSETTING(    0xf0, DEF_STR( 2C_8C ) )
  942.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
  943.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  944.     PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
  945.     PORT_DIPSETTING(    0x60, DEF_STR( 1C_7C ) )
  946.     PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
  947.  
  948.     PORT_START    /* IN3 */
  949.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  950.     PORT_DIPSETTING(    0x00, "2" )
  951.     PORT_DIPSETTING(    0x01, "3" )
  952.     PORT_DIPSETTING(    0x02, "4" )
  953.     PORT_DIPSETTING(    0x03, "5" )
  954.     PORT_DIPNAME( 0x04, 0x04, "Language" )
  955.     PORT_DIPSETTING(    0x04, "English" )
  956.     PORT_DIPSETTING(    0x00, "Italian" )
  957.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Bonus_Life ) )
  958.     PORT_DIPSETTING(    0x00, "75000" )
  959.     PORT_DIPSETTING(    0x08, "150000" )
  960.     PORT_DIPSETTING(    0x10, "200000" )
  961.     PORT_DIPSETTING(    0x18, "None" )
  962.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  963.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  964.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  965.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  966.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  967.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  968.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  969.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  970.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  971. INPUT_PORTS_END
  972.  
  973. INPUT_PORTS_START( hunchbks )
  974.     PORT_START    /* IN0 */
  975.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  976.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  977.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  978.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  979.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  980.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  981.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  982.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  983.  
  984.     PORT_START    /* IN1 */
  985.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  986.     PORT_DIPSETTING(    0x01, "3" )
  987.     PORT_DIPSETTING(    0x00, "5" )
  988.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
  989.     PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
  990.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/5" )
  991.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  992.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  993.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  994.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  995.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  996.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  997.  
  998.     PORT_START    /* IN2 */
  999.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1000.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Bonus_Life ) )
  1001.     PORT_DIPSETTING(    0x00, "10000" )
  1002.     PORT_DIPSETTING(    0x02, "20000" )
  1003.     PORT_DIPSETTING(    0x04, "40000" )
  1004.     PORT_DIPSETTING(    0x06, "80000" )
  1005.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  1006.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1007.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  1008.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  1009.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  1010.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  1011.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* protection check? */
  1012. INPUT_PORTS_END
  1013.  
  1014. static struct GfxLayout charlayout =
  1015. {
  1016.     8,8,    /* 8*8 characters */
  1017.     256,    /* 256 characters */
  1018.     2,    /* 2 bits per pixel */
  1019.     { 0, 256*8*8 },    /* the two bitplanes are separated */
  1020.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1021.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1022.     8*8    /* every char takes 8 consecutive bytes */
  1023. };
  1024. static struct GfxLayout spritelayout =
  1025. {
  1026.     16,16,    /* 16*16 sprites */
  1027.     64,    /* 64 sprites */
  1028.     2,    /* 2 bits per pixel */
  1029.     { 0, 64*16*16 },    /* the two bitplanes are separated */
  1030.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1031.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1032.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1033.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1034.     32*8    /* every sprite takes 32 consecutive bytes */
  1035. };
  1036. static struct GfxLayout mariner_charlayout =
  1037. {
  1038.     8,8,    /* 8*8 characters */
  1039.     512,    /* 512 characters */
  1040.     2,    /* 2 bits per pixel */
  1041.     { 0, 512*8*8 },    /* the two bitplanes are separated */
  1042.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1043.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1044.     8*8    /* every char takes 8 consecutive bytes */
  1045. };
  1046. static struct GfxLayout mariner_spritelayout =
  1047. {
  1048.     16,16,    /* 16*16 sprites */
  1049.     128,    /* 128 sprites */
  1050.     2,    /* 2 bits per pixel */
  1051.     { 0, 128*16*16 },    /* the two bitplanes are separated */
  1052.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1053.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1054.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1055.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1056.     32*8    /* every sprite takes 32 consecutive bytes */
  1057. };
  1058. static struct GfxLayout devilfsh_charlayout =
  1059. {
  1060.     8,8,    /* 8*8 characters */
  1061.     256,    /* 256 characters */
  1062.     2,    /* 2 bits per pixel */
  1063.     { 0, 2*256*8*8 },    /* the bitplanes are separated */
  1064.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1065.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1066.     8*8    /* every char takes 8 consecutive bytes */
  1067. };
  1068. static struct GfxLayout devilfsh_spritelayout =
  1069. {
  1070.     16,16,    /* 16*16 sprites */
  1071.     64,    /* 64 sprites */
  1072.     2,    /* 2 bits per pixel */
  1073.     { 0, 2*64*16*16 },    /* the bitplanes are separated */
  1074.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1075.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1076.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1077.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1078.     32*8    /* every sprite takes 32 consecutive bytes */
  1079. };
  1080. static struct GfxLayout newsin7_charlayout =
  1081. {
  1082.     8,8,    /* 8*8 characters */
  1083.     256,    /* 256 characters */
  1084.     3,    /* 3 bits per pixel */
  1085.     { 0, 2*256*8*8, 2*2*256*8*8 },    /* the bitplanes are separated */
  1086.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1087.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1088.     8*8    /* every char takes 8 consecutive bytes */
  1089. };
  1090. static struct GfxLayout newsin7_spritelayout =
  1091. {
  1092.     16,16,    /* 16*16 sprites */
  1093.     64,    /* 64 sprites */
  1094.     3,    /* 3 bits per pixel */
  1095.     { 0, 2*64*16*16, 2*2*64*16*16 },    /* the bitplanes are separated */
  1096.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1097.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1098.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1099.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1100.     32*8    /* every sprite takes 32 consecutive bytes */
  1101. };
  1102. static struct GfxLayout bulletlayout =
  1103. {
  1104.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1105.     7,1,    /* it's just 1 pixel, but we use 7*1 to position it correctly */
  1106.     1,    /* just one */
  1107.     1,    /* 1 bit per pixel */
  1108.     { 0 },
  1109.     { 3, 0, 0, 0, 0, 0, 0 },    /* I "know" that this bit of the */
  1110.     { 0 },                        /* graphics ROMs is 1 */
  1111.     0    /* no use */
  1112. };
  1113. static struct GfxLayout theend_bulletlayout =
  1114. {
  1115.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1116.     7,1,    /* 4*1 line, I think - 7*1 to position it correctly */
  1117.     1,    /* just one */
  1118.     1,    /* 1 bit per pixel */
  1119.     { 0 },
  1120.     { 2, 2, 2, 2, 0, 0, 0 },    /* I "know" that this bit of the */
  1121.     { 0 },                        /* graphics ROMs is 1 */
  1122.     0    /* no use */
  1123. };
  1124. static struct GfxLayout backgroundlayout =
  1125. {
  1126.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1127.     8,8,
  1128.     32,    /* one for each column */
  1129.     7,    /* 128 colors max */
  1130.     { 1, 2, 3, 4, 5, 6, 7 },
  1131.     { 0*8*8, 1*8*8, 2*8*8, 3*8*8, 4*8*8, 5*8*8, 6*8*8, 7*8*8 },
  1132.     { 0, 8, 16, 24, 32, 40, 48, 56 },
  1133.     8*8*8    /* each character takes 64 bytes */
  1134. };
  1135.  
  1136.  
  1137. static struct GfxDecodeInfo scramble_gfxdecodeinfo[] =
  1138. {
  1139.     { REGION_GFX1, 0, &charlayout,             0, 8 },
  1140.     { REGION_GFX1, 0, &spritelayout,           0, 8 },
  1141.     { REGION_GFX1, 0, &bulletlayout,         8*4, 1 },    /* 1 color code instead of 2, so all */
  1142.                                                 /* shots will be yellow */
  1143.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1144.     { -1 } /* end of array */
  1145. };
  1146.  
  1147. static struct GfxDecodeInfo theend_gfxdecodeinfo[] =
  1148. {
  1149.     { REGION_GFX1, 0, &charlayout,             0, 8 },
  1150.     { REGION_GFX1, 0, &spritelayout,           0, 8 },
  1151.     { REGION_GFX1, 0, &theend_bulletlayout,  8*4, 2 },
  1152.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1153.     { -1 } /* end of array */
  1154. };
  1155.  
  1156. static struct GfxDecodeInfo mariner_gfxdecodeinfo[] =
  1157. {
  1158.     { REGION_GFX1, 0, &mariner_charlayout,     0, 8 },
  1159.     { REGION_GFX1, 0, &mariner_spritelayout,   0, 8 },
  1160.     { REGION_GFX1, 0, &bulletlayout,         8*4, 1 },    /* 1 color code instead of 2, so all */
  1161.                                                 /* shots will be yellow */
  1162.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1163.     { -1 } /* end of array */
  1164. };
  1165.  
  1166. static struct GfxDecodeInfo devilfsh_gfxdecodeinfo[] =
  1167. {
  1168.     { REGION_GFX1, 0x0000, &devilfsh_charlayout,    0, 8 },
  1169.     { REGION_GFX1, 0x0800, &devilfsh_spritelayout,  0, 8 },
  1170.     { REGION_GFX1, 0x0000, &bulletlayout,         8*4, 1 },    /* 1 color code instead of 2, so all */
  1171.                                                     /* shots will be yellow */
  1172.     { 0,           0x0000, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1173.     { -1 } /* end of array */
  1174. };
  1175.  
  1176. static struct GfxDecodeInfo newsin7_gfxdecodeinfo[] =
  1177. {
  1178.     { REGION_GFX1, 0x0000, &newsin7_charlayout,     0, 4 },
  1179.     { REGION_GFX1, 0x0800, &newsin7_spritelayout,   0, 4 },
  1180.     { REGION_GFX1, 0x0000, &bulletlayout,         8*4, 1 },    /* 1 color code instead of 2, so all */
  1181.                                                     /* shots will be yellow */
  1182.     { 0,           0x0000, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1183.     { -1 } /* end of array */
  1184. };
  1185.  
  1186.  
  1187.  
  1188. static struct AY8910interface scramble_ay8910_interface =
  1189. {
  1190.     2,    /* 2 chips */
  1191.     14318000/8,    /* 1.78975 MHz */
  1192.     { MIXERG(30,MIXER_GAIN_2x,MIXER_PAN_CENTER), MIXERG(30,MIXER_GAIN_2x,MIXER_PAN_CENTER) },
  1193.     { soundlatch_r },
  1194.     { scramble_portB_r },
  1195.     { 0 },
  1196.     { 0 }
  1197. };
  1198.  
  1199. static struct AY8910interface froggers_ay8910_interface =
  1200. {
  1201.     1,    /* 1 chip */
  1202.     14318000/8,    /* 1.78975 MHz */
  1203.     { MIXERG(80,MIXER_GAIN_2x,MIXER_PAN_CENTER) },
  1204.     { soundlatch_r },
  1205.     { frogger_portB_r },
  1206.     { 0 },
  1207.     { 0 }
  1208. };
  1209.  
  1210. static struct AY8910interface triplep_ay8910_interface =
  1211. {
  1212.     1,    /* 1 chip */
  1213.     14318000/8,    /* 1.78975 MHz */
  1214.     { 50 },
  1215.     { 0 },
  1216.     { 0 },
  1217.     { 0 },
  1218.     { 0 }
  1219. };
  1220.  
  1221.  
  1222. #define hotshock_sound_readmem    scramble_sound_readmem
  1223. #define hotshock_sound_writemem    scramble_sound_writemem
  1224.  
  1225. #define hotshock_ay8910_interface    scramble_ay8910_interface
  1226.  
  1227.  
  1228. #define DRIVER_2CPU(NAME, GFXDECODE, MAINMEM, SOUND, VHSTART)    \
  1229. static struct MachineDriver machine_driver_##NAME =                \
  1230. {                                                                \
  1231.     /* basic machine hardware */                                \
  1232.     {                                                            \
  1233.         {                                                        \
  1234.             CPU_Z80,                                            \
  1235.             18432000/6,    /* 3.072 MHz */                            \
  1236.             MAINMEM##_readmem,MAINMEM##_writemem,0,0,            \
  1237.             scramble_vh_interrupt,1                                \
  1238.         },                                                        \
  1239.         {                                                        \
  1240.             CPU_Z80 | CPU_AUDIO_CPU,                            \
  1241.             14318000/8,    /* 1.78975 MHz */                        \
  1242.             SOUND##_sound_readmem,SOUND##_sound_writemem,SOUND##_sound_readport,SOUND##_sound_writeport,    \
  1243.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */                                \
  1244.         }                                                        \
  1245.     },                                                            \
  1246.     60, 2500,    /* frames per second, vblank duration */        \
  1247.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */                \
  1248.     0,                                                            \
  1249.                                                                 \
  1250.     /* video hardware */                                        \
  1251.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },                    \
  1252.     GFXDECODE##_gfxdecodeinfo,                                    \
  1253.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */                    \
  1254.     galaxian_vh_convert_color_prom,                                \
  1255.                                                                 \
  1256.     VIDEO_TYPE_RASTER,                                            \
  1257.     0,                                                            \
  1258.     VHSTART##_vh_start,                                            \
  1259.     generic_vh_stop,                                            \
  1260.     galaxian_vh_screenrefresh,                                    \
  1261.                                                                 \
  1262.     /* sound hardware */                                        \
  1263.     0,0,0,0,                                                    \
  1264.     {                                                            \
  1265.         {                                                        \
  1266.             SOUND_AY8910,                                        \
  1267.             &SOUND##_ay8910_interface                            \
  1268.         }                                                        \
  1269.     }                                                            \
  1270. }
  1271.  
  1272. /*            NAME      GFXDECODE  MAINMEM   SOUND     VHSTART     */
  1273. DRIVER_2CPU(scramble, scramble,  scramble, scramble, scramble);
  1274. DRIVER_2CPU(theend,   theend,    scramble, scramble, scramble);
  1275. DRIVER_2CPU(froggers, scramble,  scramble, froggers, scramble);
  1276. DRIVER_2CPU(mars,     scramble,  mars,     scramble, scramble);
  1277. DRIVER_2CPU(devilfsh, devilfsh,  mars,     scramble, scramble);
  1278. DRIVER_2CPU(newsin7,  newsin7,   mars,     scramble, scramble);
  1279. DRIVER_2CPU(ckongs,   mariner,   ckongs,   scramble, ckongs);
  1280. DRIVER_2CPU(hotshock, mariner,   hotshock, hotshock, pisces);
  1281.  
  1282.  
  1283. /* Triple Punch and Mariner are different - only one CPU, one 8910 */
  1284. static struct MachineDriver machine_driver_triplep =
  1285. {
  1286.     /* basic machine hardware */
  1287.     {
  1288.         {
  1289.             CPU_Z80,
  1290.             18432000/6,    /* 3.072 MHz */
  1291.             scramble_readmem,triplep_writemem,triplep_readport,triplep_writeport,
  1292.             scramble_vh_interrupt,1
  1293.         }
  1294.     },
  1295.     60, 2500,/* ? */    /* frames per second, vblank duration */
  1296.     1,    /* single CPU, no need for interleaving */
  1297.     0,
  1298.  
  1299.     /* video hardware */
  1300.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1301.     scramble_gfxdecodeinfo,
  1302.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1303.     galaxian_vh_convert_color_prom,
  1304.  
  1305.     VIDEO_TYPE_RASTER,
  1306.     0,
  1307.     scramble_vh_start,
  1308.     generic_vh_stop,
  1309.     galaxian_vh_screenrefresh,
  1310.  
  1311.     /* sound hardware */
  1312.     0,0,0,0,
  1313.     {
  1314.         {
  1315.             SOUND_AY8910,
  1316.             &triplep_ay8910_interface
  1317.         }
  1318.     }
  1319. };
  1320.  
  1321. static struct MachineDriver machine_driver_mariner =
  1322. {
  1323.     /* basic machine hardware */
  1324.     {
  1325.         {
  1326.             CPU_Z80,
  1327.             18432000/6,    /* 3.072 MHz */
  1328.             mariner_readmem,triplep_writemem,triplep_readport,triplep_writeport,
  1329.             mariner_vh_interrupt,1
  1330.         }
  1331.     },
  1332.     60, 2500,    /* frames per second, vblank duration */
  1333.     1,    /* single CPU, no need for interleaving */
  1334.     0,
  1335.  
  1336.     /* video hardware */
  1337.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1338.     mariner_gfxdecodeinfo,
  1339.     32+64+16,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 16 for background */
  1340.     mariner_vh_convert_color_prom,
  1341.  
  1342.     VIDEO_TYPE_RASTER,
  1343.     0,
  1344.     mariner_vh_start,
  1345.     generic_vh_stop,
  1346.     galaxian_vh_screenrefresh,
  1347.  
  1348.     /* sound hardware */
  1349.     0,0,0,0,
  1350.     {
  1351.         {
  1352.             SOUND_AY8910,
  1353.             &triplep_ay8910_interface
  1354.         }
  1355.     }
  1356. };
  1357.  
  1358. /**********************************************************/
  1359. /* hunchbks is *very* different, as it uses an S2650 CPU */
  1360. /*  epoxied in a plastic case labelled Century Playpack   */
  1361. /**********************************************************/
  1362.  
  1363. static struct MachineDriver machine_driver_hunchbks =
  1364. {
  1365.     /* basic machine hardware */
  1366.     {
  1367.         {
  1368.             CPU_S2650,
  1369.             18432000/6,
  1370.             hunchbks_readmem,hunchbks_writemem,0,0,
  1371.             hunchbks_vh_interrupt,1
  1372.         },
  1373.         {
  1374.             CPU_Z80 | CPU_AUDIO_CPU,
  1375.             14318000/8,    /* 1.78975 MHz */
  1376.             scramble_sound_readmem,scramble_sound_writemem,scramble_sound_readport,scramble_sound_writeport,
  1377.             ignore_interrupt,1
  1378.         }
  1379.     },
  1380.     60, 2500,    /* frames per second, vblank duration */
  1381.     1,
  1382.     0,
  1383.  
  1384.     /* video hardware */
  1385.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1386.     scramble_gfxdecodeinfo,
  1387.     32+64+10,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 10 for background */
  1388.     galaxian_vh_convert_color_prom,
  1389.  
  1390.     VIDEO_TYPE_RASTER,
  1391.     0,
  1392.     scramble_vh_start,
  1393.     generic_vh_stop,
  1394.     galaxian_vh_screenrefresh,
  1395.  
  1396.     /* sound hardware */
  1397.     0,0,0,0,
  1398.     {
  1399.         {
  1400.             SOUND_AY8910,
  1401.             &scramble_ay8910_interface
  1402.         }
  1403.     }
  1404. };
  1405.  
  1406. /***************************************************************************
  1407.  
  1408.   Game driver(s)
  1409.  
  1410. ***************************************************************************/
  1411.  
  1412. ROM_START( scramble )
  1413.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1414.     ROM_LOAD( "2d.k",         0x0000, 0x0800, 0xea35ccaa )
  1415.     ROM_LOAD( "2e.k",         0x0800, 0x0800, 0xe7bba1b3 )
  1416.     ROM_LOAD( "2f.k",         0x1000, 0x0800, 0x12d7fc3e )
  1417.     ROM_LOAD( "2h.k",         0x1800, 0x0800, 0xb59360eb )
  1418.     ROM_LOAD( "2j.k",         0x2000, 0x0800, 0x4919a91c )
  1419.     ROM_LOAD( "2l.k",         0x2800, 0x0800, 0x26a4547b )
  1420.     ROM_LOAD( "2m.k",         0x3000, 0x0800, 0x0bb49470 )
  1421.     ROM_LOAD( "2p.k",         0x3800, 0x0800, 0x6a5740e5 )
  1422.  
  1423.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1424.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xbcd297f0 )
  1425.     ROM_LOAD( "5d",           0x0800, 0x0800, 0xde7912da )
  1426.     ROM_LOAD( "5e",           0x1000, 0x0800, 0xba2fa933 )
  1427.  
  1428.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1429.     ROM_LOAD( "5f.k",         0x0000, 0x0800, 0x4708845b )
  1430.     ROM_LOAD( "5h.k",         0x0800, 0x0800, 0x11fd2887 )
  1431.  
  1432.     ROM_REGION( 0x0020, REGION_PROMS )
  1433.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1434. ROM_END
  1435.  
  1436. ROM_START( scrambls )
  1437.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1438.     ROM_LOAD( "2d",           0x0000, 0x0800, 0xb89207a1 )
  1439.     ROM_LOAD( "2e",           0x0800, 0x0800, 0xe9b4b9eb )
  1440.     ROM_LOAD( "2f",           0x1000, 0x0800, 0xa1f14f4c )
  1441.     ROM_LOAD( "2h",           0x1800, 0x0800, 0x591bc0d9 )
  1442.     ROM_LOAD( "2j",           0x2000, 0x0800, 0x22f11b6b )
  1443.     ROM_LOAD( "2l",           0x2800, 0x0800, 0x705ffe49 )
  1444.     ROM_LOAD( "2m",           0x3000, 0x0800, 0xea26c35c )
  1445.     ROM_LOAD( "2p",           0x3800, 0x0800, 0x94d8f5e3 )
  1446.  
  1447.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1448.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xbcd297f0 )
  1449.     ROM_LOAD( "5d",           0x0800, 0x0800, 0xde7912da )
  1450.     ROM_LOAD( "5e",           0x1000, 0x0800, 0xba2fa933 )
  1451.  
  1452.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1453.     ROM_LOAD( "5f",           0x0000, 0x0800, 0x5f30311a )
  1454.     ROM_LOAD( "5h",           0x0800, 0x0800, 0x516e029e )
  1455.  
  1456.     ROM_REGION( 0x0020, REGION_PROMS )
  1457.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1458. ROM_END
  1459.  
  1460. ROM_START( atlantis )
  1461.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1462.     ROM_LOAD( "2c",           0x0000, 0x0800, 0x0e485b9a )
  1463.     ROM_LOAD( "2e",           0x0800, 0x0800, 0xc1640513 )
  1464.     ROM_LOAD( "2f",           0x1000, 0x0800, 0xeec265ee )
  1465.     ROM_LOAD( "2h",           0x1800, 0x0800, 0xa5d2e442 )
  1466.     ROM_LOAD( "2j",           0x2000, 0x0800, 0x45f7cf34 )
  1467.     ROM_LOAD( "2l",           0x2800, 0x0800, 0xf335b96b )
  1468.  
  1469.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1470.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xbcd297f0 )
  1471.     ROM_LOAD( "5d",           0x0800, 0x0800, 0xde7912da )
  1472.     ROM_LOAD( "5e",           0x1000, 0x0800, 0xba2fa933 )
  1473.  
  1474.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1475.     ROM_LOAD( "5f",           0x0000, 0x0800, 0x57f9c6b9 )
  1476.     ROM_LOAD( "5h",           0x0800, 0x0800, 0xe989f325 )
  1477.  
  1478.     ROM_REGION( 0x0020, REGION_PROMS )
  1479.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1480. ROM_END
  1481.  
  1482. ROM_START( atlants2 )
  1483.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1484.     ROM_LOAD( "rom1",         0x0000, 0x0800, 0xad348089 )
  1485.     ROM_LOAD( "rom2",         0x0800, 0x0800, 0xcaa705d1 )
  1486.     ROM_LOAD( "rom3",         0x1000, 0x0800, 0xe420641d )
  1487.     ROM_LOAD( "rom4",         0x1800, 0x0800, 0x04792d90 )
  1488.     ROM_LOAD( "rom5",         0x2000, 0x0800, 0x6eaf510d )
  1489.     ROM_LOAD( "rom6",         0x2800, 0x0800, 0xb297bd4b )
  1490.     ROM_LOAD( "rom7",         0x3000, 0x0800, 0xa50bf8d5 )
  1491.     ROM_LOAD( "rom8",         0x3800, 0x0800, 0xd2c5c984 )
  1492.  
  1493.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1494.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xbcd297f0 )
  1495.     ROM_LOAD( "5d",           0x0800, 0x0800, 0xde7912da )
  1496.     ROM_LOAD( "5e",           0x1000, 0x0800, 0xba2fa933 )
  1497.  
  1498.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1499.     ROM_LOAD( "rom9",         0x0000, 0x0800, 0x55cd5acd )
  1500.     ROM_LOAD( "rom10",        0x0800, 0x0800, 0x72e773b8 )
  1501.  
  1502.     ROM_REGION( 0x0020, REGION_PROMS )
  1503.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1504. ROM_END
  1505.  
  1506. ROM_START( theend )
  1507.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1508.     ROM_LOAD( "ic13_1t.bin",  0x0000, 0x0800, 0x93e555ba )
  1509.     ROM_LOAD( "ic14_2t.bin",  0x0800, 0x0800, 0x2de7ad27 )
  1510.     ROM_LOAD( "ic15_3t.bin",  0x1000, 0x0800, 0x035f750b )
  1511.     ROM_LOAD( "ic16_4t.bin",  0x1800, 0x0800, 0x61286b5c )
  1512.     ROM_LOAD( "ic17_5t.bin",  0x2000, 0x0800, 0x434a8f68 )
  1513.     ROM_LOAD( "ic18_6t.bin",  0x2800, 0x0800, 0xdc4cc786 )
  1514.  
  1515.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1516.     ROM_LOAD( "ic56_1.bin",   0x0000, 0x0800, 0x7a141f29 )
  1517.     ROM_LOAD( "ic55_2.bin",   0x0800, 0x0800, 0x218497c1 )
  1518.  
  1519.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1520.     ROM_LOAD( "ic30_2c.bin",  0x0000, 0x0800, 0x68ccf7bf )
  1521.     ROM_LOAD( "ic31_1c.bin",  0x0800, 0x0800, 0x4a48c999 )
  1522.  
  1523.     ROM_REGION( 0x0020, REGION_PROMS )
  1524.     ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, 0x24652bc4 )
  1525. ROM_END
  1526.  
  1527. ROM_START( theends )
  1528.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1529.     ROM_LOAD( "ic13",         0x0000, 0x0800, 0x90e5ab14 )
  1530.     ROM_LOAD( "ic14",         0x0800, 0x0800, 0x950f0a07 )
  1531.     ROM_LOAD( "ic15",         0x1000, 0x0800, 0x6786bcf5 )
  1532.     ROM_LOAD( "ic16",         0x1800, 0x0800, 0x380a0017 )
  1533.     ROM_LOAD( "ic17",         0x2000, 0x0800, 0xaf067b7f )
  1534.     ROM_LOAD( "ic18",         0x2800, 0x0800, 0xa0411b93 )
  1535.  
  1536.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1537.     ROM_LOAD( "ic56",         0x0000, 0x0800, 0x3b2c2f70 )
  1538.     ROM_LOAD( "ic55",         0x0800, 0x0800, 0xe0429e50 )
  1539.  
  1540.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1541.     ROM_LOAD( "ic30",         0x0000, 0x0800, 0x527fd384 )
  1542.     ROM_LOAD( "ic31",         0x0800, 0x0800, 0xaf6d09b6 )
  1543.  
  1544.     ROM_REGION( 0x0020, REGION_PROMS )
  1545.     ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, 0x24652bc4 )
  1546. ROM_END
  1547.  
  1548. ROM_START( froggers )
  1549.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1550.     ROM_LOAD( "vid_d2.bin",   0x0000, 0x0800, 0xc103066e )
  1551.     ROM_LOAD( "vid_e2.bin",   0x0800, 0x0800, 0xf08bc094 )
  1552.     ROM_LOAD( "vid_f2.bin",   0x1000, 0x0800, 0x637a2ff8 )
  1553.     ROM_LOAD( "vid_h2.bin",   0x1800, 0x0800, 0x04c027a5 )
  1554.     ROM_LOAD( "vid_j2.bin",   0x2000, 0x0800, 0xfbdfbe74 )
  1555.     ROM_LOAD( "vid_l2.bin",   0x2800, 0x0800, 0x8a4389e1 )
  1556.  
  1557.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1558.     ROM_LOAD( "frogger.608",  0x0000, 0x0800, 0xe8ab0256 )
  1559.     ROM_LOAD( "frogger.609",  0x0800, 0x0800, 0x7380a48f )
  1560.     ROM_LOAD( "frogger.610",  0x1000, 0x0800, 0x31d7eb27 )
  1561.  
  1562.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1563.     ROM_LOAD( "epr-1036.1k",  0x0000, 0x0800, 0x658745f8 )
  1564.     ROM_LOAD( "frogger.607",  0x0800, 0x0800, 0x05f7d883 )
  1565.  
  1566.     ROM_REGION( 0x0020, REGION_PROMS )
  1567.     ROM_LOAD( "vid_e6.bin",   0x0000, 0x0020, 0x0b878b54 )
  1568. ROM_END
  1569.  
  1570. ROM_START( amidars )
  1571.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1572.     ROM_LOAD( "am2d",         0x0000, 0x0800, 0x24b79547 )
  1573.     ROM_LOAD( "am2e",         0x0800, 0x0800, 0x4c64161e )
  1574.     ROM_LOAD( "am2f",         0x1000, 0x0800, 0xb3987a72 )
  1575.     ROM_LOAD( "am2h",         0x1800, 0x0800, 0x29873461 )
  1576.     ROM_LOAD( "am2j",         0x2000, 0x0800, 0x0fdd54d8 )
  1577.     ROM_LOAD( "am2l",         0x2800, 0x0800, 0x5382f7ed )
  1578.     ROM_LOAD( "am2m",         0x3000, 0x0800, 0x1d7109e9 )
  1579.     ROM_LOAD( "am2p",         0x3800, 0x0800, 0xc9163ac6 )
  1580.  
  1581.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1582.     ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, 0x8ca7b750 )
  1583.     ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, 0x9b5bdc0a )
  1584.  
  1585.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1586.     ROM_LOAD( "2716.a6",      0x0000, 0x0800, 0x2082ad0a )   /* Same graphics ROMs as Amigo */
  1587.     ROM_LOAD( "2716.a5",      0x0800, 0x0800, 0x3029f94f )
  1588.  
  1589.     ROM_REGION( 0x0020, REGION_PROMS )
  1590.     ROM_LOAD( "amidar.clr",   0x0000, 0x0020, 0xf940dcc3 )
  1591. ROM_END
  1592.  
  1593. ROM_START( triplep )
  1594.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1595.     ROM_LOAD( "triplep.2g",   0x0000, 0x1000, 0xc583a93d )
  1596.     ROM_LOAD( "triplep.2h",   0x1000, 0x1000, 0xc03ddc49 )
  1597.     ROM_LOAD( "triplep.2k",   0x2000, 0x1000, 0xe83ca6b5 )
  1598.     ROM_LOAD( "triplep.2l",   0x3000, 0x1000, 0x982cc3b9 )
  1599.  
  1600.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1601.     ROM_LOAD( "triplep.5f",   0x0000, 0x0800, 0xd51cbd6f )
  1602.     ROM_LOAD( "triplep.5h",   0x0800, 0x0800, 0xf21c0059 )
  1603.  
  1604.     ROM_REGION( 0x0020, REGION_PROMS )
  1605.     ROM_LOAD( "tripprom.6e",  0x0000, 0x0020, 0x624f75df )
  1606. ROM_END
  1607.  
  1608. ROM_START( knockout )
  1609.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1610.     ROM_LOAD( "knockout.2h",   0x0000, 0x1000, 0xeaaa848e )
  1611.     ROM_LOAD( "knockout.2k",   0x1000, 0x1000, 0xbc26d2c0 )
  1612.     ROM_LOAD( "knockout.2l",   0x2000, 0x1000, 0x02025c10 )
  1613.     ROM_LOAD( "knockout.2m",   0x3000, 0x1000, 0xe9abc42b )
  1614.  
  1615.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1616.     ROM_LOAD( "triplep.5f",   0x0000, 0x0800, 0xd51cbd6f )
  1617.     ROM_LOAD( "triplep.5h",   0x0800, 0x0800, 0xf21c0059 )
  1618.  
  1619.     ROM_REGION( 0x0020, REGION_PROMS )
  1620.     ROM_LOAD( "tripprom.6e",  0x0000, 0x0020, 0x624f75df )
  1621. ROM_END
  1622.  
  1623. ROM_START( mariner )
  1624.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
  1625.     ROM_LOAD( "tp1.2h",       0x0000, 0x1000, 0xdac1dfd0 )
  1626.     ROM_LOAD( "tm2.2k",       0x1000, 0x1000, 0xefe7ca28 )
  1627.     ROM_LOAD( "tm3.2l",       0x2000, 0x1000, 0x027881a6 )
  1628.     ROM_LOAD( "tm4.2m",       0x3000, 0x1000, 0xa0fde7dc )
  1629.     ROM_LOAD( "tm5.2p",       0x6000, 0x0800, 0xd7ebcb8e )
  1630.     ROM_CONTINUE(             0x5800, 0x0800             )
  1631.  
  1632.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1633.     ROM_LOAD( "tm8.5f",       0x0000, 0x1000, 0x70ae611f )
  1634.     ROM_LOAD( "tm9.5h",       0x1000, 0x1000, 0x8e4e999e )
  1635.  
  1636.     ROM_REGION( 0x0020, REGION_PROMS )
  1637.     ROM_LOAD( "t4.6e",        0x0000, 0x0020, 0xca42b6dd )
  1638.  
  1639.     ROM_REGION( 0x0100, REGION_USER1 )
  1640.     ROM_LOAD( "t6.6p",        0x0000, 0x0100, 0xad208ccc )    /* background color prom */
  1641.  
  1642.     ROM_REGION( 0x0020, REGION_USER2 )
  1643.     ROM_LOAD( "t5.7p",        0x0000, 0x0020, 0x1bd88cff )    /* star placement (not emulated) */
  1644. ROM_END
  1645.  
  1646. ROM_START( 800fath )
  1647.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
  1648.     ROM_LOAD( "tu1.2h",       0x0000, 0x1000, 0x5dd3d42f )
  1649.     ROM_LOAD( "tm2.2k",       0x1000, 0x1000, 0xefe7ca28 )
  1650.     ROM_LOAD( "tm3.2l",       0x2000, 0x1000, 0x027881a6 )
  1651.     ROM_LOAD( "tm4.2m",       0x3000, 0x1000, 0xa0fde7dc )
  1652.     ROM_LOAD( "tu5.2p",       0x6000, 0x0800, 0xf864a8a6 )
  1653.     ROM_CONTINUE(             0x5800, 0x0800             )
  1654.  
  1655.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1656.     ROM_LOAD( "tm8.5f",       0x0000, 0x1000, 0x70ae611f )
  1657.     ROM_LOAD( "tm9.5h",       0x1000, 0x1000, 0x8e4e999e )
  1658.  
  1659.     ROM_REGION( 0x0020, REGION_PROMS )
  1660.     ROM_LOAD( "t4.6e",        0x0000, 0x0020, 0xca42b6dd )
  1661.  
  1662.     ROM_REGION( 0x0100, REGION_USER1 )
  1663.     ROM_LOAD( "t6.6p",        0x0000, 0x0100, 0xad208ccc )    /* background color prom */
  1664.  
  1665.     ROM_REGION( 0x0020, REGION_USER2 )
  1666.     ROM_LOAD( "t5.7p",        0x0000, 0x0020, 0x1bd88cff )    /* star placement (not emulated) */
  1667. ROM_END
  1668.  
  1669. ROM_START( ckongs )
  1670.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1671.     ROM_LOAD( "vid_2c.bin",   0x0000, 0x1000, 0x49a8c234 )
  1672.     ROM_LOAD( "vid_2e.bin",   0x1000, 0x1000, 0xf1b667f1 )
  1673.     ROM_LOAD( "vid_2f.bin",   0x2000, 0x1000, 0xb194b75d )
  1674.     ROM_LOAD( "vid_2h.bin",   0x3000, 0x1000, 0x2052ba8a )
  1675.     ROM_LOAD( "vid_2j.bin",   0x4000, 0x1000, 0xb377afd0 )
  1676.     ROM_LOAD( "vid_2l.bin",   0x5000, 0x1000, 0xfe65e691 )
  1677.  
  1678.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1679.     ROM_LOAD( "turt_snd.5c",  0x0000, 0x1000, 0xf0c30f9a )
  1680.     ROM_LOAD( "snd_5d.bin",   0x1000, 0x1000, 0x892c9547 )
  1681.  
  1682.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1683.     ROM_LOAD( "vid_5f.bin",   0x0000, 0x1000, 0x7866d2cb )
  1684.     ROM_LOAD( "vid_5h.bin",   0x1000, 0x1000, 0x7311a101 )
  1685.  
  1686.     ROM_REGION( 0x0020, REGION_PROMS )
  1687.     ROM_LOAD( "vid_6e.bin",   0x0000, 0x0020, 0x5039af97 )
  1688. ROM_END
  1689.  
  1690. ROM_START( mars )
  1691.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1692.     ROM_LOAD( "u26.3",        0x0000, 0x0800, 0x2f88892c )
  1693.     ROM_LOAD( "u56.4",        0x0800, 0x0800, 0x9e6bcbf7 )
  1694.     ROM_LOAD( "u69.5",        0x1000, 0x0800, 0xdf496e6e )
  1695.     ROM_LOAD( "u98.6",        0x1800, 0x0800, 0x75f274bb )
  1696.     ROM_LOAD( "u114.7",       0x2000, 0x0800, 0x497fd8d0 )
  1697.     ROM_LOAD( "u133.8",       0x2800, 0x0800, 0x3d4cd59f )
  1698.  
  1699.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1700.     ROM_LOAD( "u39.9",        0x0000, 0x0800, 0xbb5968b9 )
  1701.     ROM_LOAD( "u51.10",       0x0800, 0x0800, 0x75fd7720 )
  1702.     ROM_LOAD( "u78.11",       0x1000, 0x0800, 0x72a492da )
  1703.  
  1704.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1705.     ROM_LOAD( "u72.1",        0x0000, 0x0800, 0x279789d0 )
  1706.     ROM_LOAD( "u101.2",       0x0800, 0x0800, 0xc5dc627f )
  1707.  
  1708.     ROM_REGION( 0x0020, REGION_PROMS )
  1709.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1710. ROM_END
  1711.  
  1712. ROM_START( devilfsh )
  1713.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1714.     ROM_LOAD( "u26.1",        0x0000, 0x0800, 0xec047d71 )
  1715.     ROM_LOAD( "u56.2",        0x0800, 0x0800, 0x0138ade9 )
  1716.     ROM_LOAD( "u69.3",        0x1000, 0x0800, 0x5dd0b3fc )
  1717.     ROM_LOAD( "u98.4",        0x1800, 0x0800, 0xded0b745 )
  1718.     ROM_LOAD( "u114.5",       0x2000, 0x0800, 0x5fd40176 )
  1719.     ROM_LOAD( "u133.6",       0x2800, 0x0800, 0x03538336 )
  1720.     ROM_LOAD( "u143.7",       0x3000, 0x0800, 0x64676081 )
  1721.     ROM_LOAD( "u163.8",       0x3800, 0x0800, 0xbc3d6770 )
  1722.  
  1723.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1724.     ROM_LOAD( "u39.9",        0x0000, 0x0800, 0x09987e2e )
  1725.     ROM_LOAD( "u51.10",       0x0800, 0x0800, 0x1e2b1471 )
  1726.     ROM_LOAD( "u78.11",       0x1000, 0x0800, 0x45279aaa )
  1727.  
  1728.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1729.     ROM_LOAD( "u72.12",       0x0000, 0x1000, 0x5406508e )
  1730.     ROM_LOAD( "u101.13",      0x1000, 0x1000, 0x8c4018b6 )
  1731.  
  1732.     ROM_REGION( 0x0020, REGION_PROMS )
  1733.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1734. ROM_END
  1735.  
  1736. ROM_START( newsin7 )
  1737.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1738.     ROM_LOAD( "newsin.1",     0x0000, 0x1000, 0xe6c23fe0 )
  1739.     ROM_LOAD( "newsin.2",     0x1000, 0x1000, 0x3d477b5f )
  1740.     ROM_LOAD( "newsin.3",     0x2000, 0x1000, 0x7dfa9af0 )
  1741.     ROM_LOAD( "newsin.4",     0x3000, 0x1000, 0xd1b0ba19 )
  1742.     ROM_LOAD( "newsin.5",     0xa000, 0x1000, 0x06275d59 )
  1743.  
  1744.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1745.     ROM_LOAD( "newsin.13",    0x0000, 0x0800, 0xd88489a2 )
  1746.     ROM_LOAD( "newsin.12",    0x0800, 0x0800, 0xb154a7af )
  1747.     ROM_LOAD( "newsin.11",    0x1000, 0x0800, 0x7ade709b )
  1748.  
  1749.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1750.     ROM_LOAD( "newsin.7",     0x2000, 0x1000, 0x6bc5d64f )
  1751.     ROM_LOAD( "newsin.8",     0x1000, 0x1000, 0x0c5b895a )
  1752.     ROM_LOAD( "newsin.9",     0x0000, 0x1000, 0x6b87adff )
  1753.  
  1754.     ROM_REGION( 0x0020, REGION_PROMS )
  1755.     ROM_LOAD( "newsin.6",     0x0000, 0x0020, 0x5cf2cd8d )
  1756. ROM_END
  1757.  
  1758. ROM_START( hotshock )
  1759.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1760.     ROM_LOAD( "hotshock.l10", 0x0000, 0x1000, 0x401078f7 )
  1761.     ROM_LOAD( "hotshock.l9",  0x1000, 0x1000, 0xaf76c237 )
  1762.     ROM_LOAD( "hotshock.l8",  0x2000, 0x1000, 0x30486031 )
  1763.     ROM_LOAD( "hotshock.l7",  0x3000, 0x1000, 0x5bde9312 )
  1764.  
  1765.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1766.     ROM_LOAD( "hotshock.b3",  0x0000, 0x1000, 0x0092f0e2 )
  1767.     ROM_LOAD( "hotshock.b4",  0x1000, 0x1000, 0xc2135a44 )
  1768.  
  1769.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1770.     ROM_LOAD( "hotshock.h4",  0x0000, 0x1000, 0x60bdaea9 )
  1771.     ROM_LOAD( "hotshock.h5",  0x1000, 0x1000, 0x4ef17453 )
  1772.  
  1773.     ROM_REGION( 0x0020, REGION_PROMS )
  1774.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  1775. ROM_END
  1776.  
  1777. ROM_START( hunchbks )
  1778.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1779.     ROM_LOAD( "2c_hb01.bin",           0x0000, 0x0800, 0x8bebd834 )
  1780.     ROM_LOAD( "2e_hb02.bin",           0x0800, 0x0800, 0x07de4229 )
  1781.     ROM_LOAD( "2f_hb03.bin",           0x2000, 0x0800, 0xb75a0dfc )
  1782.     ROM_LOAD( "2h_hb04.bin",           0x2800, 0x0800, 0xf3206264 )
  1783.     ROM_LOAD( "2j_hb05.bin",           0x4000, 0x0800, 0x1bb78728 )
  1784.     ROM_LOAD( "2l_hb06.bin",           0x4800, 0x0800, 0xf25ed680 )
  1785.     ROM_LOAD( "2m_hb07.bin",           0x6000, 0x0800, 0xc72e0e17 )
  1786.     ROM_LOAD( "2p_hb08.bin",           0x6800, 0x0800, 0x412087b0 )
  1787.  
  1788.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1789.     ROM_LOAD( "11d_snd.bin",           0x0000, 0x0800, 0x88226086 )
  1790.  
  1791.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1792.     ROM_LOAD( "5f_hb09.bin",           0x0000, 0x0800, 0xdb489c3d )
  1793.     ROM_LOAD( "5h_hb10.bin",           0x0800, 0x0800, 0x3977650e )
  1794.  
  1795.     ROM_REGION( 0x0020, REGION_PROMS )
  1796.     ROM_LOAD( "6e_prom.bin",           0x0000, 0x0020, 0x01004d3f )
  1797. ROM_END
  1798.  
  1799.  
  1800.  
  1801. static void init_scrambls(void)
  1802. {
  1803.     install_mem_read_handler(0, 0x8102, 0x8102, scramble_input_port_2_r);
  1804.     install_mem_read_handler(0, 0x8202, 0x8202, scramble_protection_r);
  1805. }
  1806.  
  1807. static void init_scramble(void)
  1808. {
  1809.     install_mem_read_handler(0, 0x8202, 0x8202, scramblk_protection_r);
  1810. }
  1811.  
  1812. static void init_hotshock(void)
  1813. {
  1814.     /* protection??? The game jumps into never-neverland here. I think
  1815.        it just expects a RET there */
  1816.     memory_region(REGION_CPU1)[0x2ef9] = 0xc9;
  1817. }
  1818.  
  1819.  
  1820. static void init_froggers(void)
  1821. {
  1822.     int A;
  1823.     unsigned char *RAM;
  1824.  
  1825.  
  1826.     /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
  1827.     RAM = memory_region(REGION_CPU2);
  1828.     for (A = 0;A < 0x0800;A++)
  1829.         RAM[A] = (RAM[A] & 0xfc) | ((RAM[A] & 1) << 1) | ((RAM[A] & 2) >> 1);
  1830. }
  1831.  
  1832. static void init_mars(void)
  1833. {
  1834.     int i;
  1835.     unsigned char *RAM;
  1836.  
  1837.     /* Address lines are scrambled on the main CPU:
  1838.  
  1839.         A0 -> A2
  1840.         A1 -> A0
  1841.         A2 -> A3
  1842.         A3 -> A1 */
  1843.  
  1844.     RAM = memory_region(REGION_CPU1);
  1845.     for (i = 0; i < 0x10000; i += 16)
  1846.     {
  1847.         int j;
  1848.         unsigned char swapbuffer[16];
  1849.  
  1850.         for (j = 0; j < 16; j++)
  1851.         {
  1852.             swapbuffer[j] = RAM[i + ((j & 1) << 2) + ((j & 2) >> 1) + ((j & 4) << 1) + ((j & 8) >> 2)];
  1853.         }
  1854.  
  1855.         memcpy(&RAM[i], swapbuffer, 16);
  1856.     }
  1857. }
  1858.  
  1859.  
  1860.  
  1861. GAME( 1981, scramble, 0,        scramble, scramble, scramble, ROT90, "Konami", "Scramble" )
  1862. GAME( 1981, scrambls, scramble, scramble, scramble, scrambls, ROT90, "[Konami] (Stern license)", "Scramble (Stern)" )
  1863. GAME( 1981, atlantis, 0,        scramble, atlantis, 0,        ROT90, "Comsoft", "Battle of Atlantis (set 1)" )
  1864. GAME( 1981, atlants2, atlantis, scramble, atlantis, 0,        ROT90, "Comsoft", "Battle of Atlantis (set 2)" )
  1865. GAME( 1980, theend,   0,        theend,   theend,   0,        ROT90, "Konami", "The End" )
  1866. GAME( 1980, theends,  theend,   theend,   theend,   0,        ROT90, "[Konami] (Stern license)", "The End (Stern)" )
  1867. GAME( 1981, froggers, frogger,  froggers, froggers, froggers, ROT90, "bootleg", "Frog" )
  1868. GAME( 1982, amidars,  amidar,   scramble, amidars,  0,        ROT90, "Konami", "Amidar (Scramble hardware)" )
  1869. GAME( 1982, triplep,  0,        triplep,  triplep,  0,        ROT90, "KKI", "Triple Punch" )
  1870. GAME( 1982, knockout, triplep,  triplep,  triplep,  0,        ROT90, "KKK", "Knock Out !!" )
  1871. GAME( 1981, mariner,  0,        mariner,  scramble, 0,        ROT90, "Amenip", "Mariner" )
  1872. GAME( 1981, 800fath,  mariner,  mariner,  scramble, 0,        ROT90, "Amenip (US Billiards Inc. license)", "800 Fathoms" )
  1873. GAME( 1981, ckongs,   ckong,    ckongs,   ckongs,   0,        ROT90, "bootleg", "Crazy Kong (Scramble hardware)" )
  1874. GAME( 1981, mars,     0,        mars,     mars,     mars,     ROT90, "Artic", "Mars" )
  1875. GAME( 1982, devilfsh, 0,        devilfsh, devilfsh, mars,     ROT90, "Artic", "Devil Fish" )
  1876. GAMEX(1983, newsin7,  0,        newsin7,  newsin7,  mars,     ROT90, "ATW USA, Inc.", "New Sinbad 7", GAME_IMPERFECT_COLORS )
  1877. GAME( 1982, hotshock, 0,        hotshock, hotshock, hotshock, ROT90, "E.G. Felaco", "Hot Shocker" )
  1878. GAME( 1983, hunchbks, hunchbkd, hunchbks, hunchbks, 0,        ROT90, "Century", "Hunchback (Scramble hardware)" )
  1879.